<!--- build test to see if Hibernate launched within CF can
		build a Java class file from a Hibernate mapping file --->
<cfscript>
	// create Hbm2JavaTask object from hibernate extensions
	javaGen = CreateObject("java", "net.sf.hibernate.tool.hbm2java.Hbm2JavaTask").init();
	
	// set the output directory
	myDir = CreateObject("java", "java.io.File");
	myDir.init(ExpandPath("lib"));
	javaGen.setOutput(myDir);
	
	// build the Ant FileSet we'll pass to javaGen
	myFile = CreateObject("java", "java.io.File");
	myFile.init(ExpandPath("lib/User.hbm.xml"));
	myFiles = CreateObject("java", "org.apache.tools.ant.types.FileSet").init();
	myFiles.setFile(myFile);
	writeOutput(myFiles.getDir());
	
	// pass myFiles to javaGen and execute
	javaGen.addFileSet(myFiles);
	javaGen.execute();
</cfscript>

<html>
<head>
	<title>Hibernate CodeGen Test</title>
</head>
<body>
	<h3>Hibernate CodeGen Test</h3>
</body>
</html>
